/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

function setXMLHttpRequest() {
    var xhr = null;
    // browser standard con supporto nativo
    if ( window.XMLHttpRequest ) {
        xhr = new XMLHttpRequest();
    }
    // MSIE 6 con ActiveX
    else if ( window.ActiveXObject ) {
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }
    return xhr;
}
var xhrObj = setXMLHttpRequest();

function MyFormHandle(val){
    xhrObj.open("GET", "ServerMayVP?MyVal=" + val, true);
    xhrObj.onreadystatechange = MyUpdate;
    xhrObj.send(null);
    return;
}

function MyUpdate(){
    var res = xhrObj.responseText;
    //alert(res);
    document.getElementById("MyDiv").innerHTML = res;
}